<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
    pageContext.setAttribute("basePath", basePath);
    String uuid = request.getParameter("uuid");
    request.setAttribute("uuid", uuid);
    String type = request.getParameter("type");
    request.setAttribute("type", type);
%>

<%@include file="../common/base.jsp" %>
<html>
<head>
    <meta charset="utf-8">
    <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection">
    <meta content="email=no" name="format-detection">
    <link rel="stylesheet" href="http://at.alicdn.com/t/font_jyd4arhx7sqbyb9.css"/>
    <link rel="stylesheet" href="${base}/admin/js/mobiscroll/mobiscroll.custom-3.0.0-beta6.min.css" type="text/css"/>
    <link rel="stylesheet" href="${base}/admin/css/reset.css?v=1.4" type="text/css"/>
    <link rel="stylesheet" href="${base}/admin/js/toastr/toastr.css?edition=${edition}" type="text/css"/>
    <title>司机申请 </title>
    <script>
        window.appid = "${appid}";
    </script>
</head>
<body>
<div class="step-one visible">
    <div class="ui-step-area flexCon">
        <div class="item"><img src="${base}/admin/images/driver_icon_basic.png"/></div>
        <div class="txt item">
            <p>第一步 基础信息</p>
            <p>为保证出行安全，请务必填写本人真实信息</p>
        </div>
    </div>
    <div class="ui-form" id="first-next">
        <form name="step-first" class="step-first">
            <input type="hidden" value="${appid}" name="appid">
            <input type="hidden" value="${agentUuid}" name="agentUuid">
            <input type="hidden" value="${companyUuid}" name="companyUuid">
            <%--<input type="hidden" value="${uuid}" name="uuid">--%>
            <!-- 用户头像 -->
            <div class="form-group">
                <label class="control-label">头像：<span class="txt-gray">（请上传清晰的正面照）</span></label>
                <div>
                    <%--用户头像--%>
                    <div class="file-img taxiadd_userphoto" id="face" <c:if
                            test='${driverCheckDto.face != null}'> style="background-image: url('${driverCheckDto.face}')" </c:if>>
                        <input class="file-input" type="text" name="face" <c:if
                                test='${driverCheckDto.face != null}'> value="${driverCheckDto.face}" </c:if>
                               data-rule-required="true" data-msg-required="请上传图片"/>
                        <input type="file" id="face-btn" name="face-btn" multiple="multiple"
                               class="form-control file-btn" placeholder="请上传图片" hidden/>
                    </div>
                </div>
            </div>
            <!-- 手机号码 -->
            <div class="form-group">
                <label class="control-label">手机号码：</label>
                <div>
                    <input type="text" name="mobile" value="${mobile}" readonly class="form-control"
                           placeholder="请填写手机号" data-rule-required="true" data-rule-phone="true"
                           data-msg-required="请填写手机号"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">姓名：</label>
                <div>
                    <input type="text" name="name" value="${driverCheckDto.name}" class="form-control"
                           placeholder="请填写真实姓名" data-rule-required="true" data-msg-required="请填写真实姓名"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">身份证号：</label>
                <div>
                    <input type="text" name="idCard" value="${driverCheckDto.idCard}" maxlength="18"
                           class="form-control" placeholder="请填写18位身份证号" data-rule-required="true"
                           data-rule-license="true" data-msg-license="请填写18位身份证号" data-msg-required="请填写18位身份证号"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">身份证照片：<span class="txt-gray">（请上传身份证正面照）</span></label>
                <div>
                    <%--身份证正面--%>
                    <div class="file-img" id="idCardFaceImg"
                         style="background-image: url('${website}${driverCheckDto.idCardFaceImg}')">
                        <input class="file-input" type="text" name="idCardFaceImg"
                               value="${driverCheckDto.idCardFaceImg}" data-rule-required="true"
                               data-msg-required="请上传图片"/>
                        <input type="file" id="idCardFaceImg-btn" name="idCardFaceImg-btn" multiple="multiple"
                               class="form-control file-btn" placeholder="请上传图片" hidden/>
                    </div>
                    <%--身份证反面--%>
                    <label class="control-label"><span class="txt-gray">请上传身份证反面照</span></label>
                    <div class="file-img" id="idCardBackImg"
                         style="background-image: url('${website}${driverCheckDto.idCardBackImg}')">
                        <input class="file-input" type="text" name="idCardBackImg"
                               value="${driverCheckDto.idCardBackImg}" data-rule-required="true"
                               data-msg-required="请上传图片"/>
                        <input type="file" id="idCardBackImg-btn" name="idCardBackImg-btn" multiple="multiple"
                               class="form-control file-btn" placeholder="请上传图片" hidden/>
                    </div>
                </div>
            </div>
            <!-- 初次领取驾照日期 -->
            <div class="form-group">
                <label class="control-label">初次领取驾照日期：</label>
                <div>
                    <input type="text" name="getDriverLicenseDate" class="form-control selectTime" readonly="readonly"
                           placeholder="请选择领取时间" data-rule-required="true" data-msg-required="请选择领取时间"/>
                </div>
            </div>
            <!-- 驾驶证照片 -->
            <div class="form-group">
                <label class="control-label">驾驶证照片：<span class="txt-gray">（请上传驾驶证正页照片）</span></label>
                <div>
                    <%--驾驶证照片正面--%>
                    <div class="file-img" id="drivingLicenceHomeImg"
                         style="background-image: url('${website}${driverCheckDto.drivingLicenceHomeImg}')">
                        <input class="file-input" type="text" name="drivingLicenceHomeImg"
                               value="${driverCheckDto.drivingLicenceHomeImg}" data-rule-required="true"
                               data-msg-required="请上传图片"/>
                        <input type="file" id="drivingLicenceHomeImg-btn" name="drivingLicenceHomeImg-btn"
                               multiple="multiple" class="form-control file-btn" placeholder="请上传图片" hidden/>
                    </div>
                    <%--驾驶证照片副面--%>
                    <label class="control-label"><span class="txt-gray">请上传驾驶证副页</span></label>
                    <div class="file-img" id="drivingLicenceSubImg"
                         style="background-image: url('${website}${driverCheckDto.drivingLicenceSubImg}')">
                        <input class="file-input" type="text" name="drivingLicenceSubImg"
                               value="${driverCheckDto.drivingLicenceSubImg}" data-rule-required="true"
                               data-msg-required="请上传图片"/>
                        <input type="file" id="drivingLicenceSubImg-btn" name="drivingLicenceSubImg-btn"
                               multiple="multiple" class="form-control file-btn" placeholder="请上传图片" hidden/>
                    </div>
                </div>
            </div>
            <!-- 从业资格证号 -->
            <div class="form-group">
                <label class="control-label">从业资格证号：</label>
                <div>
                    <input type="text" name="certificateNo" value="${driverCheckDto.certificateNo}" class="form-control"
                           placeholder="请填写18~19位从业资格证号" data-rule-required="true" data-msg-required="请填写18~19位从业资格证号"
                           data-rule-rangelength="[18,19]"/>
                </div>
            </div>
            <!-- 从业资格证号有效期 -->
            <div class="form-group">
                <label class="control-label">从业资格证号有效期：</label>
                <div>
                    <input type="text" name="networkCarProofOff" class="form-control selectTime2" readonly="readonly"
                           placeholder="请选择从业资格证号有效期" data-rule-required="true" data-msg-required="请选择从业资格证号有效期"/>
                </div>
            </div>
            <!-- 从业资格证号照片 -->
            <div class="form-group">
                <label class="control-label">从业资格证号照片：<span class="txt-gray">（请上传从业资格证号照片）</span></label>
                <div>
                    <%--从业资格证号照片--%>
                    <div class="file-img" id="certificateImage"
                         style="background-image: url('${website}${driverCheckDto.certificateImage}')">
                        <input class="file-input" type="text" name="certificateImage"
                               value="${driverCheckDto.certificateImage}" data-rule-required="true"
                               data-msg-required="请上传图片"/>
                        <input type="file" id="certificateImage-btn" name="certificateImage-btn" multiple="multiple"
                               class="form-control file-btn" placeholder="请上传图片" hidden/>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <a class="ui-btn next-step-btn" href="javascript:void(0);">下一步</a>
            </div>

            <%--头像--提示--%>
            <div class="upload-tip-area hide" id="face-area">
                <div class="tip-area">
                    <p><img src="${base}/admin/images/face.png"/></p>
                    <p>支持得图片格式：jpg、png</p>
                    <p>确保身份证内容完整清晰可见</p>
                    <p><a class="ui-btn" href="javascript:void(0);">上传照片</a></p>
                </div>
            </div>

            <%--身份证正面--提示--%>
            <div class="upload-tip-area hide" id="idCardFaceImg-area">
                <div class="tip-area">
                    <p><img src="${base}/admin/images/driver-ren(4).png"/></p>
                    <p>支持得图片格式：jpg、png</p>
                    <p>确保身份证内容完整清晰可见</p>
                    <p><a class="ui-btn" href="javascript:void(0);">上传照片</a></p>
                </div>
            </div>
            <%--身份证背面--提示--%>
            <div class="upload-tip-area hide" id="idCardBackImg-area">
                <div class="tip-area">
                    <p><img src="${base}/admin/images/driver-ren(3).png"/></p>
                    <p>支持得图片格式：jpg、png</p>
                    <p>确保身份证内容完整清晰可见</p>
                    <p><a class="ui-btn" href="javascript:void(0);">上传照片</a></p>
                </div>
            </div>
            <%--驾驶证正面照片--提示--%>
            <div class="upload-tip-area hide" id="drivingLicenceHomeImg-area">
                <div class="tip-area">
                    <p><img src="${base}/admin/images/driver-ren(2).png"/></p>
                    <p>支持得图片格式：jpg、png</p>
                    <p>确保身份证内容完整清晰可见</p>
                    <p><a class="ui-btn" href="javascript:void(0);">上传照片</a></p>
                </div>
            </div>
            <%--驾驶证反面照片--提示--%>
            <div class="upload-tip-area hide" id="drivingLicenceSubImg-area">
                <div class="tip-area">
                    <p><img src="${base}/admin/images/driver-ren(1).png"/></p>
                    <p>支持得图片格式：jpg、png</p>
                    <p>确保身份证内容完整清晰可见</p>
                    <p><a class="ui-btn" href="javascript:void(0);">上传照片</a></p>
                </div>
            </div>
            <%--从业资格证照片--提示--%>
            <div class="upload-tip-area hide" id="certificateImage-area">
                <div class="tip-area">
                    <p><img src="${base}/admin/images/certificateImage.png"/></p>
                    <p>支持得图片格式：jpg、png</p>
                    <p>确保身份证内容完整清晰可见</p>
                    <p><a class="ui-btn" href="javascript:void(0);">上传照片</a></p>
                </div>
            </div>
        </form>
    </div>
</div>


<!--司机申请第二步-->
<div class="step-apply-area" style="">
    <div class="ui-back-btn"><span>&#139</span></div>
    <div class="ui-step-area flexCon">
        <!-- <div class="step-img"><img src="${base}/admin/images/paperwork2.jpg"/></div> -->
        <div class="item"><img src="${base}/admin/images/driver_icon_car.png"/></div>
        <div class="txt item">
            <p>第二步 车辆信息</p>
            <p>为保证出行安全，请务必填写本人驾驶证信息</p>
        </div>
    </div>
    <div class="ui-form">
        <form name="step-second" class="step-second">
            <!-- 所属区域 -->
            <div class="form-group">
                <label class="control-label">所属区域：</label>
                <div>
                    <select id="agentUuidHtml" name="agentUuid" type="text" class="form-control" placeholder="请选择所属区域"
                            data-rule-required="true" data-msg-required="请选择所属区域">
                        <!-- 异步渲染所属区域列表 -->
                    </select>
                </div>
            </div>
            <!-- 出租车公司 -->
            <div class="form-group">
                <label class="control-label">出租车公司：</label>
                <div>
                    <select id="companyUuidHtml" name="companyUuid" type="text" class="form-control"
                            placeholder="请选择所属区域" data-rule-required="true" data-msg-required="请选择所属区域">
                        <!-- 异步渲染出租车公司列表 -->
                    </select>
                </div>
            </div>
            <!-- 车牌号码 -->
            <div class="form-group">
                <label class="control-label">车牌号码：</label>
                <div>
                    <input id="plateNum" type="text" name="plateNum" value="${driverCheckDto.plateNum}"
                           class="form-control" placeholder="请输入车牌号码" data-rule-maxlength="8" data-rule-Space="true"
                           data-rule-indexOfSpace="true" data-rule-Special="true" data-rule-required="true"
                           data-msg-required="请输入车牌号码"/>
                </div>
            </div>
            <!-- 经营许可证 -->
            <div class="form-group">
                <label class="control-label">营运证号：</label>
                <div>
                    <input type="text" name="licenseNo" value="${driverCheckDto.licenseNo}" class="form-control"
                           placeholder="请填写12位营运证号" data-rule-required="true" data-msg-required="请填写12位营运证号"
                           data-rule-licenseNo="请填写12位营运证号"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">行驶证照片：<span class="txt-gray">（请上传行驶证正页照片）</span></label>
                <div>
                    <%--驾驶证正页--%>
                    <div class="file-img" id="drivingPic"
                         style="background-image: url('${website}${driverCheckDto.drivingPic}')">
                        <input class="file-input" type="text" name="drivingPic" value="${driverCheckDto.drivingPic}"
                               data-rule-required="true" data-msg-required="请上传图片"/>
                        <input type="file" id="drivingPic-btn" name="drivingPic-btn" multiple="multiple"
                               class="form-control file-btn" placeholder="请上传图片" hidden/>
                    </div>
                    <%--驾驶证副页--%>
                    <label class="control-label"><span class="txt-gray">请上传行驶证副页照片</span></label>
                    <div class="file-img" id="drivingPicBack"
                         style="background-image: url('${website}${driverCheckDto.drivingPicBack}')">
                        <input class="file-input" type="text" name="drivingPicBack"
                               value="${driverCheckDto.drivingPicBack}" data-rule-required="true"
                               data-msg-required="请上传图片"/>
                        <input type="file" id="drivingPicBack-btn" name="drivingPicBack-btn" multiple="multiple"
                               class="form-control file-btn" placeholder="请上传图片" hidden/>
                    </div>
                </div>
            </div>
            <!-- 营运证照片 -->
            <div class="form-group">
                <label class="control-label">道路运输证（营运证）照片<span class="txt-gray">（请上传营运证照片）</span></label>
                <div>
                    <%--营运证照片--%>
                    <div class="file-img" id="operationCertificateImg"
                         style="background-image: url('${website}${driverCheckDto.operationCertificateImg}')">
                        <input class="file-input" type="text" name="operationCertificateImg"
                               value="${driverCheckDto.operationCertificateImg}" data-rule-required="true"
                               data-msg-required="请上传图片"/>
                        <input type="file" id="operationCertificateImg-btn" name="operationCertificateImg-btn"
                               multiple="multiple" class="form-control file-btn" placeholder="请上传图片" hidden/>
                    </div>
                </div>
            </div>
            <!-- 监督卡照片 -->
            <div class="form-group">
                <label class="control-label">监督卡照片<span class="txt-gray">（请上传监督卡照片）</span></label>
                <div>
                    <div class="file-img" id="monitoringCardImg"
                         style="background-image: url('${website}${driverCheckDto.monitoringCardImg}')">
                        <input class="file-input" type="text" name="monitoringCardImg"
                               value="${driverCheckDto.monitoringCardImg}" data-rule-required="true"
                               data-msg-required="请上传图片"/>
                        <input type="file" id="monitoringCardImg-btn" name="monitoringCardImg-btn" multiple="multiple"
                               class="form-control file-btn" placeholder="请上传图片" hidden/>
                    </div>
                </div>
            </div>
            <!-- 人车合影 -->
            <div class="form-group">
                <label class="control-label">人车合影<span class="txt-gray">（请上传清晰的人车合影照片）</span></label>
                <div>
                    <div class="file-img" id="mancarImg"
                         style="background-image: url('${website}${driverCheckDto.mancarImg}')">
                        <input class="file-input" type="text" name="mancarImg" value="${driverCheckDto.mancarImg}"
                               data-rule-required="true" data-msg-required="请上传图片"/>
                        <input type="file" id="mancarImg-btn" name="mancarImg-btn" multiple="multiple"
                               class="form-control file-btn" placeholder="请上传图片" hidden/>
                    </div>
                </div>
            </div>


            <div class="form-group">
                <a class="ui-btn save-btn" id="know-btn" href="javascript:void(0);">提交</a>
            </div>
            <%--行驶证照片(正面)--提示--%>
            <div class="upload-tip-area hide" id="drivingPic-area">
                <div class="tip-area">
                    <p><img src="${base}/admin/images/drivingPic.png"/></p>
                    <p>支持得图片格式：jpg、png</p>
                    <p>确保身份证内容完整清晰可见</p>
                    <p><a class="ui-btn" href="javascript:void(0);">上传照片</a></p>
                </div>
            </div>
            <%--行驶证照片(反面)--提示--%>
            <div class="upload-tip-area hide" id="drivingPicBack-area">
                <div class="tip-area">
                    <p><img src="${base}/admin/images/drivingPicBack.png"/></p>
                    <p>支持得图片格式：jpg、png</p>
                    <p>确保身份证内容完整清晰可见</p>
                    <p><a class="ui-btn" href="javascript:void(0);">上传照片</a></p>
                </div>
            </div>
            <%--道路运输证照片--提示--%>
            <div class="upload-tip-area hide" id="operationCertificateImg-area">
                <div class="tip-area">
                    <p><img src="${base}/admin/images/operationCertificateImg.png"/></p>
                    <p>支持得图片格式：jpg、png</p>
                    <p>确保身份证内容完整清晰可见</p>
                    <p><a class="ui-btn" href="javascript:void(0);">上传照片</a></p>
                </div>
            </div>
            <%--行监督卡照片--提示--%>
            <div class="upload-tip-area hide" id="monitoringCardImg-area">
                <div class="tip-area">
                    <p><img src="${base}/admin/images/monitoringCardImg.png"/></p>
                    <p>支持得图片格式：jpg、png</p>
                    <p>确保身份证内容完整清晰可见</p>
                    <p><a class="ui-btn" href="javascript:void(0);">上传照片</a></p>
                </div>
            </div>
            <%--行人车合影--提示--%>
            <div class="upload-tip-area hide" id="mancarImg-area">
                <div class="tip-area">
                    <p><img src="${base}/admin/images/mancarImg.png"/></p>
                    <p>支持得图片格式：jpg、png</p>
                    <p>确保身份证内容完整清晰可见</p>
                    <p><a class="ui-btn" href="javascript:void(0);">上传照片</a></p>
                </div>
            </div>
        </form>
    </div>
</div>

<style>
    .fixed-layer {
        position: fixed !important;
    }
</style>
<!--保存提示浮层-->
<div class="ui-toastr-layer hide fixed-layer">
    <div class="layer-content">
        <div class="layer-area">
            <p>保存成功！</p>
            <p>车主认证信息会在7个工作日内完成审核，通过即可接单</p>
            <p class="ui-border-top"><a class="txt-orange" id="iknow-btn"> 我知道了</a></p>
        </div>
    </div>
</div>
<link rel="stylesheet" href="${base}/admin/js/jquer_shijian/shijian.css">
<script type="text/javascript" src="${base}/admin/js/jquery.min-2.2.4.js"></script>
<script type="text/javascript" src="${base}/admin/js/toastr/toastr.js"></script>
<script src="${base}/admin/js/ajaxfileupload.js"></script>
<script src="${base}/admin/js/localResize/LocalResizeIMG.js"></script>
<script src="${base}/admin/js/localResize/mobileBUGFix.mini.js"></script>
<script type="text/javascript" src="${base}/admin/js/mobiscroll/mobiscroll.custom-3.0.0-beta6.min.js"></script>
<script type="text/javascript" src="${base}/admin/js/validate/jquery.validate.min.js"></script>
<script type="text/javascript" src="${base}/activity/giftCollection/js/ajaxUtil.js?edit=0131"></script>
<script type="text/javascript" src="${base}/admin/js/validate/validate.bootstrap.js?edit=0131"></script>
<%--<script src="${base}/admin/js/jquer_shijian/jquer_shijian.js" type="text/javascript"></script>--%>
<script src="${base}/admin/js/jquer_shijian/datePicker.js" type="text/javascript"></script>
<script type="text/javascript">
  var website = '${website}'
    $(function () {
        var now = new Date();
        var year = now.getFullYear();
        var month = now.getMonth();
        var date = now.getDate();
        month = month + 1;
        if (month < 10) month = "0" + month;
        if (date < 10) date = "0" + date;
        var nowDate = nowDate = year + "-" + month + "-" + date;
        var calendar = new datePicker();
        calendar.init({
            'trigger': '.selectTime', /*按钮选择器，用于触发弹出插件*/
            'type': 'date',/*模式：date日期；datetime日期时间；time时间；ym年月；*/
            'minDate': (year - 60) + "-" + month + "-" + date,/*最小日期*/
            'maxDate': nowDate,/*最大日期*/
            'onSubmit': function () {/*确认时触发事件*/
                var theSelectData = calendar.value;
                $('.selectTime').focus()
            },
            'onClose': function () {/*取消时触发事件*/
                $('.selectTime').focus()
            }
        });
        var calendar1 = new datePicker();
        calendar1.init({
            'trigger': '.selectTime2', /*按钮选择器，用于触发弹出插件*/
            'type': 'date',/*模式：date日期；datetime日期时间；time时间；ym年月；*/
            'minDate': nowDate,/*最小日期*/
            'maxDate': (year + 60) + "-" + month + "-" + date,/*最大日期*/
            'onSubmit': function () {/*确认时触发事件*/
                var theSelectData = calendar.value;
                $('.selectTime2').focus()
            },
            'onClose': function () {/*取消时触发事件*/
                $('.selectTime2').focus()
            }
        });

        $('.selectTime,.selectTime2').on("focus", function () {
            document.activeElement.blur();//屏蔽默认键盘弹出；
        });

        //时间类型回显
        var tim1 = "${driverCheckDto.getDriverLicenseDate}"
        var tim2 = "${driverCheckDto.networkCarProofOff}"
        if (tim1 != "") {
            $("input[name='getDriverLicenseDate']").val(formatterDate(new Date(tim1)))
        }
        if (tim2 != "") {
            $("input[name='networkCarProofOff']").val(formatterDate(new Date(tim2)))
        }


        function formatterDate(date) {
            var datetime = date.getFullYear()
                + "-"// "年"
                + ((date.getMonth() + 1) >= 10 ? (date.getMonth() + 1) : "0"
                    + (date.getMonth() + 1))
                + "-"// "月"
                + (date.getDate() < 10 ? "0" + date.getDate() : date
                    .getDate());
            return datetime;
        }


        //URL获取参数
        // 获取url参数
        function getQueryString(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) return unescape(r[2]);
            return null;
        }

        //点击上传图片 ，禁止显示键盘
        $(".file-input").focus(function () {
            document.activeElement.blur();
        });
        //点击上传图片 ，禁止显示键盘
        $(".file-input").focus(function () {
            document.activeElement.blur();
        });


//        上传文件方法
        var updataLong = '<div class="load-fileImg" style="display: block;"> <p>上传中</p> <div class="load1"></div> <div class="load2"></div> <div class="load3"></div> </div>'

        function updataFile(name) {
            var t = $('#' + name),
                ta = $('#' + name + '-area'),
                tt = $('input[name="' + name + '"]'),
                tp = $('#' + name + '-pic'),
                tb = $('#' + name + '-btn');
            //触发提示
            t.on('click', function () {
                ta.show();
            });
            // 提示弹窗的操作,触发选择文件
            ta.find('.ui-btn').on('click', function () {
                ta.hide();
                t.unbind('click');
                tb.show();//文件区域show之后，文本区域不在触发弹出示例
                tb.trigger('click');
            });
            //注册上传文件方法
            console.log(tb.attr('id'));
            tb.on('change', function (event) {
                var vel = this.value;
                var size = getPhotoSize(this);
                if (size <= 0) {
                    return;
                }
                if (vel) {
                    if (!/\.(gif|jpen|jpg|jpeg|bmp|png)$/i.test(vel.toLowerCase())) {
                        $.toastr.error("选择文件错误,图片类型必须是gif,jpen,jpg,jpeg,bmp,png中的一种");
                        return;
                    }
                }
                var formData = new FormData();
                formData.append('file', $(this)[0].files[0]);
                formData.append('appid', "${appid}");
                formData.append('mobile', $('input[name="phone"]').val());
                formData.append('imageType', 'avatar');
                //打开遮挡
                t.append(updataLong)
                imgBase64.setOption({
                    files: $(this)[0].files[0],
                    callback: function (img) {
                        var formData = new FormData();
                        formData.append('imageFile', img);
                        formData.append('appid', "${appid}");
                        formData.append('mobile', $('input[name="mobile"]').val());
                        formData.append('imageType', 'avatar');
                        //打开遮挡
                        t.append(updataLong);
                        $.ajax({
                            type: "POST",
                            url: "${base}/admin/driver/uploadB64",
                            data: JSON.stringify(
                                {
                                    'imageFile': img,
                                    'appid': "${appid}",
                                    'mobile': $('input[name="mobile"]').val(),
                                }
                            ),
                            contentType: 'application/json',
                            success: function (result) {
                                if (result.success) {
                                    tt.val((result.data).replace(/^(https|http|ftp|rtsp|mms)?\:\/\/([0-9a-zA-Z\.\:\/\-_]+)images/i, ''));
                                    t.css("background-image", "url('" + website + result.data + "')");
                                    tp.attr('src', website + result.data);
                                    ta.hide();
                                    //关闭遮挡
                                    t.find('.load-fileImg').remove();
                                } else {
                                    //关闭遮挡
                                    t.find('.load-fileImg').remove();
                                    $.toastr.error("上传失败");
                                }

                            },
                            error: function (result, status, e) {
                                //关闭遮挡
                                t.find('.load-fileImg').remove();
                                $.toastr.error("请求异常，请联系管理员");
                            }
                        });
                    }
                })
            });

        }

        //获取文件大小
        function getPhotoSize(obj) {
            var fileSize = 0;
            var isIE = /msie/i.test(navigator.userAgent) && !window.opera;
            if (isIE && !obj.files) {
                var filePath = obj.value;
                var fileSystem = new ActiveXObject("Scripting.FileSystemObject");
                var file = fileSystem.GetFile(filePath);
                fileSize = file.Size;
            } else {
                fileSize = obj.files[0].size;
            }
            fileSize = Math.round(fileSize / 1024 * 100) / 100; //单位为KB
            return fileSize;
        }

        // 需要上传图片name 数组
        var updataArr = ['face', 'idCardFaceImg', 'idCardBackImg', 'drivingLicenceHomeImg', 'drivingLicenceSubImg', 'certificateImage', 'drivingPic', 'drivingPicBack', 'operationCertificateImg', 'monitoringCardImg', 'mancarImg'];

        function eachUpdataArr(updataArr) {
            for (var i = 0; i < updataArr.length; i++) {
                var inu = updataArr[i];
                updataFile(inu)
            }
        }

        eachUpdataArr(updataArr)

        //校验成功跳转页面
        var validator1 = $('.step-first').validate();
        $(".next-step-btn").click(function () {
            if (validator1.form()) {
                $('[name="licenseNum"]').val($('[name="idCard"]').val());
                $('.step-one').removeClass('visible');
                $('.step-apply-area').addClass('visible');
                window.scrollTo(0, 0);
                return false;
            }
        });
        //校验成功跳转页面
        var validator2 = $('.step-second').validate();
        // 需要提交的参数Map
        parem = {};
        $(".save-btn").click(function () {
            if (validator2.form()) {
                // 遍历获取第一步骤填写的数据
                $('form[name="step-first"]').find('[type="hidden"],[type="text"],[type="date"]').each(function () {
                    var t = $(this);
                    parem[t.attr('name')] = t.val();
                })
                // 遍历获取第二步骤填写的数据
                $('form[name="step-second"]').find('[type="hidden"],[type="text"],[type="date"]').each(function () {
                    var t = $(this);
                    parem[t.attr('name')] = t.val();
                })
                submitFrom()
            }
        });

        //鼠标点击输入框，提示文本清除
        //获取上传图片地址
        $('.file-img').click(function () {
            if ($('.file-img').has('img').length = 1) {
                $('.file-img .error').text('');
            }
        });

        // 司机注册表单提交
        function submitFrom() {
            if (!!getQueryString('inviter')) {
                parem['inviter'] = getQueryString('inviter') || '';
                parem['inviterType'] = getQueryString('inviterType') || '';
            }

            console.log(parem);
            $("#know-btn").attr("disabled", true);
            $.ajax({
                url: "${base}/admin/taxiDriver/addRegister",
                data: parem,
                type: 'POST',
                async: false,
                success: function (data) {
                    $("#know-btn").attr("disabled", false);
                    if (data.success) {
                        $('.ui-toastr-layer').removeClass('hide');
                    } else {
                        $(".sure-btn").attr("disabled", false);
                        $.toastr.error("注册失败，错误信息：" + data.msg);
                    }
                },
                error: function (e) {
                    $("#know-btn").attr("disabled", false);
                    $(".sure-btn").attr("disabled", false);
                    $.toastr.error("操作失败");
                }
            });
        }
    })
</script>
<script>
    // 所属区域代理数据请求
    function areaRequest(appid) {
        $.ajax({
            url: '${base}/admin/driver/listAgent',
            type: 'POST',
            dataType: 'JSON',
            data: {"appid": appid, "businessType": 1},
        })
            .done(function (res) {
                if (res.success) {
                    areaHtml(res.data)
                    $('#agentUuidHtml').change();
                } else {
                    $.toastr.error(res.msg);
                }
            })
            .fail(function (err) {
                console.log("error");
            });
    }

    // 所属区域代理渲染
    function areaHtml(list) {
        var html = '';
        var htmls = [];
        list.forEach(function (item, index, arr) {
            var agentUuid = "${driverCheckDto.agentUuid}";
            if (agentUuid == item.uuid) {
                html = '<option selected value="' + item.uuid + '">' + item.name + '</option>';
                companyRequset(item.uuid)
               $('#agentUuidHtml').attr("disabled",true);
            } else {
                html = '<option value="' + item.uuid + '">' + item.name + '</option>';
            }
            htmls.push(html)
        })
        $('#agentUuidHtml').html(htmls)
    }

    // 出租车公司数据请求
    function companyRequset(agentUuid) {
        $.ajax({
            url: '${base}/admin/driver/listCompany',
            type: 'POST',
            dataType: 'JSON',
            data: {
                "appid": '${appid}',
                "agentUuid": agentUuid,
                "businessType": 1
            },
        })
            .done(function (res) {
                if (res.success) {
                    companyHtml(res.data)
                } else {
                    companyHtml([]);
                    $.toastr.error(res.msg);
                }
            })
            .fail(function (err) {
                console.log("error");
            });
    }

    // 出租车数据渲染
    function companyHtml(list) {
        var html = '';
        var htmls = [];
        list.forEach(function (item, index, arr) {
            var companyUuid = "${driverCheckDto.companyUuid}";
            if (companyUuid == item.uuid) {
                html = '<option selected value="' + item.uuid + '">' + item.shortName + '</option>';
               $('#companyUuidHtml').attr("disabled",true);
            } else {
                html = '<option value="' + item.uuid + '">' + item.shortName + '</option>';
            }
            htmls.push(html);
        });
        $('#companyUuidHtml').html(htmls)
    }

    (function () {
         // 区域信息变动监听
        $(document).on('change', '#agentUuidHtml', function (e) {
            companyRequset($(this).val())
            $('#companyUuidHtml').attr("disabled",false);
        })
        // 初始化区域信息
        areaRequest('${appid}');

    })()
</script>
</body>
</html>
